{extend name="base" /}
{block name="body"}
<div class="layui-card">
    <div class="layui-card-body">
        <form action="{:request()->url()}" class="layui-form" method="post" enctype="">
            <div class="layui-form-item">
                <label class="layui-form-label">{$Think.lang.name}</label>
                <div class="layui-input-inline">
                    <input type="text" name="name" value="{$data.name|default=''}" autocomplete="off" placeholder="请输入名称" lay-verify="required|name" class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">{$Think.lang.describe}</label>
                <div class="layui-input-inline">
                    <textarea placeholder="请输入描述" name="describe" class="layui-textarea">{$data.describe|default=''}</textarea>
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">视频分类</label>
                <div class="layui-input-inline">
                    <select name="type" lay-verify="required">
                        <option value="">请选择分类</option>
                        <option value="1" {if condition="isset($data) and $data.type eq 1"}selected{/if}>消费者</option>
                        <option value="2" {if condition="isset($data) and $data.type eq 2"}selected{/if}>创业者</option>
                        <option value="3" {if condition="isset($data) and $data.type eq 3"}selected{/if}>供应商</option>
                        <option value="4" {if condition="isset($data) and $data.type eq 4"}selected{/if}>小伙伴</option>
                      </select>
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">{$Think.lang.img}</label>
                <div class="layui-input-inline">
                    <img class="layui-upload-img" id="test-upload-normal-img" src="{$data.img|default='__AD_IMG__/business_license.png'}" width="50" height="50">
                    <input type="hidden" name="img" value="{$data.img|default=''}" autocomplete="off" placeholder="" class="layui-input">
                    <button type="button" class="layui-btn ajax-avatar">上传</button>
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">视频</label>
                <div class="layui-input-inline">
                    <video src="{$data.video|default='__AD_IMG__/business_license.png'}" id="upload-video" style="object-fit:fill;max-width:200px;height:auto;max-height:150px;" autoplay="autoplay" autobuffer="" autoloop="" loop="" controls="controls"></video>
                    <input type="hidden" name="video" value="{$data.video|default=''}" autocomplete="off" placeholder="" class="layui-input">
                    <button type="button" class="layui-btn ajax-video">上传</button>
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">状态</label>
                <div class="layui-input-block">
                    <input type="hidden" name="status" value="0">
                    <input type="checkbox" name="status" value="1" lay-skin="switch" lay-text="启用|禁用" {if isset($data.status) and $data.status eq '1'}checked{/if}>
                </div>
            </div>
            <div class="layui-form-item">
                <div class="layui-input-block">
                    <button class="layui-btn" lay-filter="i" lay-submit="">保存</button>
                    <button class="layui-btn layui-btn-primary" type="reset">重置</button>
                </div>
            </div>
        </form>
    </div>
</div>
{/block}
